﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CC98.Text.UBB
{
    public enum PieceType : int
    {
        Start,
        End,
        Text,
    }

    public struct UBBPiece
    {
        /// <summary>
        /// Piece type
        /// </summary>
        public PieceType Type;

        /// <summary>
        /// The content of this ubb piece
        /// NOTE:
        ///     if Type == PieceType.End then the content has already cut the char /
        /// </summary>
        public string Content;

        /// <summary>
        /// The argument of this ubb piece
        /// NOTE:
        ///     if Type != PieceType.Start then this property will be null
        /// </summary>
        public string Argument;

        /// <summary>
        /// The match index (start or end)
        /// NOTE:
        ///     -1 mean not match
        /// </summary>
        public int MatchedIndex;
    }
}
